﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<InternshipManagement.Models.Document>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    CreateEdit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
    <% 
        string action = ViewBag.Op == "Create" ? "Create" : "Edit";
        ViewBag.DocumentOp = ViewBag.Op == "Create" ? 2 : 3;
        Html.RenderPartial("DocumentMenu"); 
    %>
<% using (Html.BeginForm(action, "Document", FormMethod.Post, new { enctype = "multipart/form-data" }))
   { %>
    <%: Html.ValidationSummary(true)%>
    <fieldset class="twocolumns">
        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Name)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Name)%>
            <%: Html.EditorFor(model => model.Name)%>
        </div>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Path)%>
        </div>
        <div class="editor-field">
            <%: Html.Label("File")%>
            <input type="file" size="43" id="attachment" name="attachment"/> 
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
<% } %>

</asp:Content>

